const path = require('path')
const compose  = require('koa-compose')
const requireContext = require('../utils/requireContext.js')

let files = requireContext(path.resolve(__dirname, './'), /(?<!router)\.js$/, true)

const routes = compose(files.map(item => require(item).routes()))

module.exports = routes